#include  <iostream>
using namespace std;
#include <math.h>
#include <algorithm>

void QuickSort(int arr[], int Lift, int Right)
{
	if (Lift >= Right)
		return;
	int i, j, k, n;
	i = Lift;
	j = Lift;
	k = Right;
	swap(arr[Lift + rand() % (Right - Lift)], arr[Right]);
	n = arr[Right];
	while (i <= Right) {
		if (arr[i] > n) {
			swap(arr[i], arr[k]);
			k--;
		}
		else if (arr[i] == n) {
			i++;
		}
		else if (arr[i] < n) {
			swap(arr[i], arr[j]);
			i++;
			j++;
		}
		if (j == k)
			break;
	}
	QuickSort(arr, Lift, j - 1);
	QuickSort(arr, k + 1, Right);
}
int main() {
	int n;
	cin >> n;
	int* arr = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	QuickSort(arr, 0, n-1);
	for (int i = 0; i < n; i++) {
		cout << arr[i] << " ";
	}
	return 0;
}
